package ca.ualberta.cs.CLRDB.interfaces;

import java.sql.Connection;
import java.util.HashMap;

import ca.ualberta.cs.CLRDB.FriendsManagement;
import ca.ualberta.cs.CLRDB.User;

public interface PersonAccess extends EntityRelAccess {

	   /**
	    *@return -2 if email exists, -3 if an exception, personId if ok
	    */
	   public int addAuthor(User user);
	   
	   /**
	    * @param user
	    * @return 0: ok, return 1: username exists, return 2: email already taken, 3: exception
	    */
	   public int addUser(User user);
	   
	   /**
	    * @param username
	    * @param pass
	    * @return HashMap<String,String> where key: state, values is: 0: ok, 1: wrong pass, 2:no such user, 3: exception, 4: role not specified
	    */
	   	public HashMap<String,String> authenticate(String username, String pass);
	   	
	   	public int getPersonId(String username, Connection con);
	   	public FriendsManagement getFriendsManagement();
}
